/**
 * Created by admin on 2018/11/12.
 */
import post from '../post/post-proxy'
let common = {
  login: (loginName, pwd) => {
    return post('oauth', 'ehome.inner.ac.login.get', {loginName, pwd})
  },
  // 获取文件服务器的下载url
  getDownloadUrl: (fileId, interfaceType) => {
    console.log('!!!!', interfaceType, fileId)
    if (interfaceType === 'workflow') {
      return post('workflow', 'ehome.workflow.attachment.download.url.get', {
        'attachmentId': fileId
      })
    } else if (interfaceType === 'job') {
      console.log('!!!!222', interfaceType, fileId)
      return post('workflow', 'ehome.workflow.job.attachment.get', {
        'attachmentId': fileId
      })
    } else {
      return post('outer', 'ehome.org.file.download.url.get', {
        'fileId': fileId
      })
    }
  },
  // 获取文件服务器的上传url
  getUploadUrl: (interfaceType) => {
    if (interfaceType === 'workflow') {
      return post('workflow', 'ehome.workflow.attachment.upload.url.get', {})
    } else if (interfaceType === 'job') {
      return post('workflow', 'ehome.workflow.job.attachment.upload.url.get', {})
    } else {
      return post('outer', 'ehome.org.file.upload.url.get', {})
    }
  },
  /**
   * 获取优惠列表
   * @author 003
   * @createDate 2019/3/12
   */
  getDiscountList: ({jqxxZj, wenJianDx, wenJianMing, wenJianZj}) => {
    let params = {
      jqxxZj: jqxxZj,
      wenJianDx: wenJianDx,
      wenJianMing: wenJianMing,
      wenJianZj: wenJianZj
    }
    return post('swaggerTest', '/yongtai/shengtai/ytszst/jingqingxx/app/fj/upload', params)
  }
}
let request = Object.assign(common)
export default request
